<?php

require '../utils/conn.php';
$query = "select * from advertising_image";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$imageurl = $row['image_url'];
$title = $row['title'];
$subtitle=$row['subtitle'];
$linkurl=$row['link_url'];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<a href='../index.php'>返回首页</a>
<hr />
<form method="post" enctype="multipart/form-data"
	action="../controllers/updateSatAd.php">
<table border='2' rules='rows' cellpadding='8%' align='center'
	width='80%'>
	<tr>
		<th colspan="2">
		<h2>更新SAT考团广告</h2>
		</th>
	</tr>
	<tr>
		<th>标题</th>
		<td><input name="title" type="text" value=<?php echo $title;?>
			size="100"></input></td>
	</tr>
	<tr>
		<th>子标题</th>
		<td><input name="subtitle" type="text" value=<?php echo $subtitle;?>
			size="140"></input></td>
	</tr>
	<tr>
		<th>广告链接</th>
		<td><input name="linkurl" type="text" value=<?php echo $linkurl;?>
			size="140"></input></td>
	</tr>
	<tr>
		<th>图片</th>
		<td><img src="<?php echo "../controllers/pic/".$imageurl;?>" width="200" height="200" /></td>
	</tr>
	<tr>
		<th></th>
		<td><input type="file" id="file" name="file"></input></td>
	</tr>
	<tr align="center">
		<td colspan="2"><input type="submit" value="更新广告"></input></td>
	</tr>
</table>
</form>
</body>
</html>
